package com.jtjrenren.android.taxi.passenger.utils;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.IntentFilter;

import com.jtjrenren.android.taxi.passenger.Constants;

/**
 * Created by Administrator on 2016/1/19.
 */
public class BrocastReceiverUtils {
    /**
     * 注册应用基础广播接受者
     * @param context
     * @param receiver
     */
    public static void registerCommonBr(Context context,BroadcastReceiver receiver){
        IntentFilter intentFilter=new IntentFilter();
        intentFilter.addAction(Constants.ACTION_NETWORK_DISCONN);
        intentFilter.addAction(Constants.ACTION_USER_NOTLOGIN);
        context.registerReceiver(receiver,intentFilter);
    }

    /**
     * 注册调度中心命令有关的广播接收者
     */
    public static IntentFilter getControlBroInfilter(){
        IntentFilter filter=new IntentFilter();
        filter.addAction(Constants.ACTION_CONTROL_RESPONSE_COMMON);
        filter.addAction(Constants.ACTION_CONTROL_RESPONSE_ORDERACCEPT);
        filter.addAction(Constants.ACTION_CONTROL_RESPONSE_ORDERAMOUNT);
        filter.addAction(Constants.ACTION_CONTROL_RESPONSE_ORDERDISPATCH);
        filter.addAction(Constants.ACTION_CONTROL_RESPONSE_ORDERDRIVERCANCLE);
        filter.addAction(Constants.ACTION_CONTROL_RESPONSE_ORDERDRIVERCOMING);
        filter.addAction(Constants.ACTION_CONTROL_RESPONSE_ORDERFILTER);
        filter.addAction(Constants.ACTION_CONTROL_RESPONSE_ORDERPASSGERINCAR);
        return filter;
    }
}
